package com.practice.dto;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.io.Serializable;

/**
 * 分页参数
 *
 * @author Noah
 * @date 2023/10/26 9:50
 */
@Data
public class PageParam implements Serializable {

    private static final Integer PAGE_NO = 1;

    private static final Integer PAGE_SIZE = 10;


    @NotNull(message = "页码不能为空")
    @Min(value = 1, message = "页码最小值为1")
    protected Integer pageNo = PAGE_NO;

    @NotNull(message = "每页条数不能为空")
    @Min(value = 1, message = "每页条数最小值为1")
    protected Integer pageSize = PAGE_SIZE;

}